﻿using Prism.Modularity;
using SmartParking.Client.MainModule.ViewModels;
using SmartParking.Client.MainModule.Views;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartParking.Client.MainModule
{
    public class MainModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {
            // 初始化的时候，添加一个组件到对应的区域
            // 比如  左侧菜单
            // 需要一个regionmanager 
            var regionManager = containerProvider.Resolve<IRegionManager>();
            regionManager.RegisterViewWithRegion("LeftMenuTreeRegion", "TreeMenuView");
            regionManager.RegisterViewWithRegion("MainHeaderRegion", typeof(MainHeaderView));
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.Register<TreeMenuView>();
            containerRegistry.Register<MainHeaderView>();
        }
    }
}
